@import "../../common/style/mixin/template";

.c7n-iam-react-quill-editor {
  position: relative;

  @include template;

  /* default header */
  .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  .ql-snow .ql-picker.ql-header .ql-picker-item::before {
    content: '标准';
  }

  /* default font */
  .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  .ql-snow .ql-picker.ql-font .ql-picker-item::before {
    content: '默认';
  }

  .ql-changeToHtml {
    margin-top: -3px;
  }

  /* font-size start */
  @mixin ql-picker-size($size) {
    &[data-value='#{$size}']::before {
      content: quote($size);
      font-size: $size;
    }
  }

  @for $i from 10 to 21 {
    .ql-snow .ql-picker.ql-size .ql-picker-label,
    .ql-snow .ql-picker.ql-size .ql-picker-item {
      @include ql-picker-size(#{$i}px);
    }
    $i: $i + 1;
  }
  /* font-size end */

  /* link start */
  .ql-snow .ql-tooltip {
    &[data-mode=link]::before {
      content: "输入链接:";
    }

    &::before {
      content: "访问链接:";
    }

    &.ql-editing a.ql-action::after {
      content: '保存';
    }

    & a {
      &.ql-action::after {
        content: '编辑';
      }

      &.ql-remove::before {
        content: '移除链接';
      }
    }
  }
  /* link end */

  .ql-snow .ql-picker.ql-font .ql-picker-label,
  .ql-snow .ql-picker.ql-font .ql-picker-item {
    &[data-value=STSong]::before {
      content: "华文宋体";
      font-family: "STSong";
    }

    &[data-value=STKaiti]::before {
      content: "华文楷体";
      font-family: "STKaiti";
    }

    &[data-value=STHeiti]::before {
      content: "华文黑体";
      font-family: "STHeiti";
    }

    &[data-value=STFangsong]::before {
      content: "华文仿宋";
      font-family: "STFangsong";
    }

    &[data-value=SimSun]::before {
      content: "宋体";
      font-family: "SimSun";
    }

    &[data-value=SimHei]::before {
      content: "黑体";
      font-family: "SimHei";
    }

    &[data-value=KaiTi]::before {
      content: "楷体";
      font-family: "KaiTi";
    }

    &[data-value=FangSong]::before {
      content: "仿宋";
      font-family: "FangSong";
    }

    &[data-value=Microsoft-YaHei]::before {
      content: "微软雅黑";
      font-family: "Microsoft-YaHei";
    }

    .ql-font-STSong {
      font-family: "STSong";
    }

    .ql-font-STKaiti {
      font-family: "STKaiti";
    }

    .ql-font-STHeiti {
      font-family: "STHeiti";
    }

    .ql-font-STFangsong {
      font-family: "STFangsong";
    }

    .ql-font-SimSun {
      font-family: "SimSun";
    }

    .ql-font-KaiTi {
      font-family: "KaiTi";
    }

    .ql-font-SimHei {
      font-family: "SimHei";
    }

    .ql-font-FangSong {
      font-family: "FangSong";
    }

    .ql-font-Microsoft-YaHei {
      font-family: "Microsoft YaHei";
    }
  }

  .ql-editor {
    white-space: normal !important;
  }
}

.c7n-editor-changedHTML-container {
  position: absolute;
  top: 0;
  width: 100%;
  height: 320px;
  border: 1px solid #ccc;
  line-height: 1.42;
  outline: none;
  background: #fff;

  &-toolbar {
    border-bottom: 2px solid #ccc;
    height: 42px;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    line-height: 42px;
    padding-left: 16px;
    background: #fff;

    span {
      cursor: pointer;
      font-weight: 500;
    }

    span:hover {
      color: #06c;
    }
  }

  .c7n-editor-changedHTML-container-content {
    width: 100%;
    height: 276px;
    padding: 12px 15px;
    outline: none;
    border: none;
    overflow-y: auto;
    -o-tab-size: 4;
    tab-size: 4;
    -moz-tab-size: 4;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

.c7n-iam-editor-modal {
  width: 560px;
  height: 547px;

  &-preview-top {
    margin-top: 6px;

    &-btn {
      position: absolute;
      top: 68px;
      right: 8px;
      color: #3f51b5;
    }
  }

  &-preview-content {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 32px auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.08);
    z-index: 40;
  }

  &-preview-pic {
    position: absolute;
    width: 320px;
    height: 320px;
    top: 0;
    left: 0;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 41;
  }

  &-preview-sentence {
    font-size: 18px;
    color: rgba(0, 0, 0, 0.54);
  }
}

.c7n-iam-editor-dragger {
  display: block;
  width: 512px;
  height: 441px;
  text-align: center;

  .icon {
    width: 80px;
    height: 80px;
    font-size: 80px;
    color: #3f51b5;
  }

  &-text {
    font-size: 18px;
    line-height: 25px;
    margin-top: 40px;
  }

  &-hint {
    font-size: 13px;
    color: rgba(0, 0, 0, .65);
    line-height: 20px;
    margin-top: 16px;
  }

  &-preview-pic {
    position: absolute;
    width: 512px;
    height: 438px;
    top: 0;
    left: 0;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 41;
  }
}
